package com.moneyhelper.common.resp;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author ygl
 * @create 2019-02-21
 * @DESCRIPTION
 **/
@Data
@EqualsAndHashCode(callSuper = false)
public class TableResponse<T> extends BaseResponse{

    TableData<T> data;


    public TableResponse(long total, List<T> rows) {
        this.data = new TableData<T>(total, rows);
    }

    public TableResponse() {
    }

    public class TableData<T> {
        @Getter
        @Setter
        List<T> rows;
        @Getter
        @Setter
        long total;

        public TableData(long total, List<T> rows) {
            this.rows = rows;
            this.total = total;
        }
    }
}
